"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_redux_1 = require("react-redux");
const Nav = require("./ui/nav");
const Common = require("./model/common");
function getMapDispatchToProps(selfMapDispatch, mapKeys) {
    return (dispatch) => {
        let connected = {};
        const connectList = [
            Nav.connect,
            Common.connect,
        ];
        connectList.forEach(fun => {
            connected = fun(dispatch, connected, mapKeys);
        });
        return selfMapDispatch ? selfMapDispatch(dispatch, connected) : connected;
    };
}
exports.default = (mapStoreToProps, mapDispatchToProps, componentClass, mapKeys = {}) => react_redux_1.connect(mapStoreToProps, getMapDispatchToProps(mapDispatchToProps, mapKeys), (a, b, c) => (Object.assign({}, a, b, c)), {})(componentClass);
